<?php

class ProductPicturesTable extends PriorityTable
{

	public function getSameLevelNodes()
	{
		return $this->findAll();
	}
  
  public function getProductPictures($user, $product_id)
  {
    return Doctrine::getTable('ProductPictures')->createQuery('pp')
      ->innerJoin('pp.Translation ppt')
      ->where('ppt.lang = ?', array($user->getCulture()))
      ->andWhere('pp.product_id = ?', array($product_id))
      ->orderBy('pp.pri ASC')
      ->execute();
  }
}